﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Skynet.WebFoundation.Controls.Runtime
{
    [DefaultProperty("Text")]
    [ToolboxData("<{0}:TextQuestionControl runat=server></{0}:TextQuestionControl>")]
    public class TextQuestionControl : CompositeControl
    {
        [Bindable(true)]
        [Category("Appearance")]
        [DefaultValue("")]
        [Localizable(true)]
        public string Text
        {
            get
            {
                String s = (String)ViewState["Text"];
                return ((s == null) ? String.Empty : s);
            }

            set
            {
                ViewState["Text"] = value;
            }
        }
        protected override void CreateChildControls()
        {
            var textbox = new TextBox(){ Text = this.Text, TextMode = TextBoxMode.MultiLine, ReadOnly = true,  SkinID = this.SkinID};
            this.Controls.Add(textbox);
        }       

    }
}
